package com.xiangyang.controller;

import com.xiangyang.entity.Drug;
import com.xiangyang.entity.Drugs;
import com.xiangyang.entity.dto.Result;
import com.xiangyang.service.IDrugService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Drug")
public class DrugController {
    @Autowired
    private IDrugService drugService;

    @PostMapping("/PharmacyOrders")
    public String UpdateDrug(@RequestBody Drug prescription) {
        System.out.println(prescription.toString());
        return drugService.UpdateDrug(prescription);
    }
    @PostMapping("/PharmacyOrders/deldete")
    public String DeleteDrug(Long prescriptionId) {
        return drugService.DeleteDrug(prescriptionId);
    }
        @PostMapping("/MedicationManagement")
    public Result selectDrugs() {
        return drugService.selectDrug();
    }


}

